package com.blacktry.entity.enums;


import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public enum KeyForClass {
     RB软工数("244"),
     RB软工移("144"),
     RB软工金("154"),
     RB软工互("164"),
     RB软工网("044"),
     数科("304");
     private String code; // 专业编号

     public static String keyForClassName(String username) {
         String major = "";
         String garden = username.substring(2, 4);
         String majorId = username.substring(6, 9);
         for (KeyForClass key : KeyForClass.values()) {
             if (key.code.equals(majorId)) {
                 major = key.name();
             }
         }
         return major +garden+ username.charAt(9) + "班";
     }
 }